﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;

namespace mvc.Controllers
{
    public class RedPacketController : Controller
    {
        /// <summary>
        /// 我的红包
        /// </summary>
        /// <returns></returns>
        public ActionResult GetRedPacket()
        {
            var res = new JsonResult();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string basePath = Server.MapPath("~");
            string json = System.IO.File.ReadAllText(basePath + "json/GetRedPacket.json");
            res.Data = serializer.DeserializeObject(json);
            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许使用GET方式获取，否则用GET获取是会报错。  
            return res;
        }

    }
}
